/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entidades;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author cegarciaa
 */
@Entity
@Table(name = "alarmavariable")
@NamedQueries({
    @NamedQuery(name = "Alarmavariable.findAll", query = "SELECT a FROM Alarmavariable a"),
    @NamedQuery(name = "Alarmavariable.findByIdalarma", query = "SELECT a FROM Alarmavariable a WHERE a.idalarma = :idalarma"),
    @NamedQuery(name = "Alarmavariable.findByLo", query = "SELECT a FROM Alarmavariable a WHERE a.lo = :lo"),
    @NamedQuery(name = "Alarmavariable.findByActivahihi", query = "SELECT a FROM Alarmavariable a WHERE a.activahihi = :activahihi"),
    @NamedQuery(name = "Alarmavariable.findByLolo", query = "SELECT a FROM Alarmavariable a WHERE a.lolo = :lolo"),
    @NamedQuery(name = "Alarmavariable.findByActivalolo", query = "SELECT a FROM Alarmavariable a WHERE a.activalolo = :activalolo"),
    @NamedQuery(name = "Alarmavariable.findByActivalo", query = "SELECT a FROM Alarmavariable a WHERE a.activalo = :activalo"),
    @NamedQuery(name = "Alarmavariable.findByActivahi", query = "SELECT a FROM Alarmavariable a WHERE a.activahi = :activahi"),
    @NamedQuery(name = "Alarmavariable.findByHi", query = "SELECT a FROM Alarmavariable a WHERE a.hi = :hi"),
    @NamedQuery(name = "Alarmavariable.findByHihi", query = "SELECT a FROM Alarmavariable a WHERE a.hihi = :hihi")})
public class Alarmavariable implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "IDALARMA")
    private Long idalarma;
    @JoinColumn(name = "IDDISPOSITIVO", referencedColumnName = "IDDISPOSITIVO", insertable = true, updatable = false,nullable=false)
    @ManyToOne(optional = false)
    private Dispositivo iddispositivo;
    @JoinColumn(name = "IDVARF", referencedColumnName = "IDVARF", insertable = true, updatable = false,nullable=false)
    @ManyToOne(optional = false)
    private Variablef idvarf;
    @Column(name = "LOLO")
    private Float lolo;
    @Column(name = "LO")
    private Float lo;
    @Column(name = "HI")
    private Float hi;
    @Column(name = "HIHI")
    private Float hihi;
    @Column(name = "ACTIVAHIHI")
    private boolean activahihi;
    @Column(name = "ACTIVAHI")
    private boolean activahi;
    @Column(name = "ACTIVALO")
    private boolean activalo;
    @Column(name = "ACTIVALOLO")
    private boolean activalolo;

    public Alarmavariable() {
    }

    public Alarmavariable(Long idalarma) {
        this.idalarma = idalarma;
    }

    public Long getIdalarma() {
        return idalarma;
    }

    public void setIdalarma(Long idalarma) {
        this.idalarma = idalarma;
    }

    public Float getLo() {
        return lo;
    }

    public void setLo(Float lo) {
        this.lo = lo;
    }

    public Boolean getActivahihi() {
        return activahihi;
    }

    public void setActivahihi(Boolean activahihi) {
        this.activahihi = activahihi;
    }

    public Float getLolo() {
        return lolo;
    }

    public void setLolo(Float lolo) {
        this.lolo = lolo;
    }

    public Boolean getActivalolo() {
        return activalolo;
    }

    public void setActivalolo(Boolean activalolo) {
        this.activalolo = activalolo;
    }

    public Boolean getActivalo() {
        return activalo;
    }

    public void setActivalo(Boolean activalo) {
        this.activalo = activalo;
    }

    public Boolean getActivahi() {
        return activahi;
    }

    public void setActivahi(Boolean activahi) {
        this.activahi = activahi;
    }

    public Float getHi() {
        return hi;
    }

    public void setHi(Float hi) {
        this.hi = hi;
    }

    public Float getHihi() {
        return hihi;
    }

    public void setHihi(Float hihi) {
        this.hihi = hihi;
    }

    public Dispositivo getIddispositivo() {
        return iddispositivo;
    }

    public void setIddispositivo(Dispositivo dispositivo) {
        this.iddispositivo = dispositivo;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idalarma != null ? idalarma.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Alarmavariable)) {
            return false;
        }
        Alarmavariable other = (Alarmavariable) object;
        if ((this.idalarma == null && other.idalarma != null) || (this.idalarma != null && !this.idalarma.equals(other.idalarma))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entidades.Alarmavariable[idalarma=" + idalarma + "]";
    }

    /**
     * @return the idvarf
     */
    public Variablef getIdvarf() {
        return idvarf;
    }

    /**
     * @param idvarf the idvarf to set
     */
    public void setIdvarf(Variablef idvarf) {
        this.idvarf = idvarf;
    }

}
